<!DOCTYPE html>
<html>
<head>
<base href="${basePath}">
<meta charset="UTF-8">
<title>修改活动</title> $!{include("import_js_css.html")}
<!-- #set(Place place,LiftClub liftClub) -->
<!-- #set(GroupUserModel user,List<GroupUserModel> responsibles) -->
</head>
<body>
	${include("header.html")}
	<div class="menu_all">
		<div class="div_search_result clear">
			<div class="panel-heading panel-result-title">
				<h3 class="panel-title">修改活动</h3>
			</div>
			<div class="panel-form-add">
				<form class="form-horizontal" role="form" action="yueyogaAdmin/updateLiftClubs.jhtml" method="post">
					<div class="panel-form-layout">
						<label for="inputLiftClubName" class="col-sm-1 control-label">主题</label>
						<div class="col-sm-3">
							<input type="text" class="form-control" name="liftClubName" id="inputLiftClubName" value="${liftClub.name}" > <input type="hidden" name="liftClubId" value="${id}">
						</div>
						<label for="inputLiftClubStatus" class="col-sm-1 control-label" style="margin-left:100px;">状态</label>
						<div class="col-sm-3">
							<select id="inputLiftClubStatus" data-live-search="true" class="selectpicker show-tick" data-width="100%" name="LiftClubStatus">
								<option value="0">准备中</option>
								<option value="1">进行中</option>
								<option value="2">活动结束</option>
								<option value="3">活动取消</option>
							</select>
						</div>
						<br /> <br /> <label for="inputCoach0" class="col-sm-1 control-label">老师</label>
						<div class="col-sm-3">
							<select id="inputCoach0" data-live-search="true" class="selectpicker show-tick" data-width="100%" name="coachType0Id">
								<option value="">&nbsp;</option>
								<!-- #for(Coach ch0 : listCoach0) -->
								<option value="${ch0.coachId}">${ch0.name}</option>
								<!-- #end -->
							</select>
						</div>

						<label for="inputCoach1" class="col-sm-1 control-label" style="margin-left:100px;">助教</label>
						<div class="col-sm-3">
							<select id="inputCoach1" data-live-search="true" class="selectpicker show-tick" data-width="100%" name="coachType1Id">
								<option value="">&nbsp;</option>
								<!-- #for(Coach ch1 : listCoach1) -->
								<option value="${ch1.coachId}">${ch1.name}</option>
								<!-- #end -->
							</select>
						</div>
						<br /> <br /> <label for="inputResponsible" class="col-sm-1 control-label">负责人</label>
						<div class="col-sm-3">
							<select id="inputResponsible" data-live-search="true" class="selectpicker show-tick" data-width="100%" name="responsibleId">
								<option value="">&nbsp;</option>
								<!-- #for(GroupUserModel respor : responsibles) -->
								<option value="${respor.id}">${respor.name==null?respor.name:respor.name}</option>
								<!-- #end -->
							</select>
						</div>
						<label for="inputPlacement" class="col-sm-1 control-label" style="margin-left:100px;">场地</label>
						<div class="col-sm-3">
							<select id="inputPlacement" data-live-search="true" class="selectpicker show-tick" data-width="100%" name="placename">
								<option value="">&nbsp;</option>
								<!-- #for(Place p : listPlace) -->
								<option value="${p.id}">${p.name}</option>
								<!-- #end -->
							</select>
						</div>

						<br /> <br /> <label for="inputStartDate" class="col-sm-1 control-label">开始时间</label>
						<div class="col-sm-3">
							<div class='input-group date' id='inputStartDate' data-date-format="YYYY-MM-DD HH:mm">
								<input id="startdate" name="startdate" type='text' class="form-control" value="${(liftClub.startdate==null||liftClub.startdate=='')?'':liftClub.startdate.substring(0,16)}" /> <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span>
								</span>
							</div>
						</div>
						<label for="inputendDate" class="col-sm-1 control-label" style="margin-left:100px;">结束时间</label>
						<div class="col-sm-3">
							<div class='input-group date' id='inputendDate' data-date-format="YYYY-MM-DD HH:mm">
								<input id="enddate" name="enddate" type='text' value="${(liftClub.enddate==null||liftClub.enddate=='')?'':liftClub.enddate.substring(0,16)}" class="form-control" /> <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span> </span>
							</div>
						</div>
						<br /> <br /> <label for="inputCreditlimits" class="col-sm-1 control-label">积分下限</label>
						<div class="col-sm-3">
							<input type="text" class="form-control" name="creditlimits" id="inputCreditlimits" value="${liftClub.creditlimits}" >
						</div>
						<br /> <br /> <label for="txtRemarks" class="col-sm-1 control-label">备注</label>
						<div class="col-sm-3">
							<textarea class="form-control panel-form-addreed" name="remarks" id="txtRemarks" >${liftClub.remarks}</textarea>
						</div>
						<br /> <br />
						<br /> <br />
						<div class="panel-btn-search">
							<button id="liftClubSave" type="submit" class="btn-ade-default" style="margin-right:50px;">保存</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<div class="div_search_result clear">
			<!--#var(PaginatedList<Member> members)-->
			<!--
		#set(
		pager = members.pager,
		totalResults = pager.getCountOfTotalResults(),
		totalPages = pager.getCountOfTotalPages() * 1,
		pageSize = pager.pageSize,
		pageNo = pager.pageNo,
		prePageNo = pager.getPrevPageNo(),
		nextPageNo = pager.getNextPageNo()
		)
		-->
			<div class="panel-heading panel-result-title">
				<h3 class="panel-title" style="width: 500px;">参加活动的会员列表</h3>
			</div>
			<!--#if(members)-->
			<table class="table table-bordered table-hover table-condensed tb" style="text-align: center">
				<tr>
					<td>编号</td>
					<td>姓名</td>
					<td>英文名</td>
					<td>手机号</td>
					<td>电话</td>
					<td>性别</td>
				</tr>
				<!-- #for(Member member:members) -->
				<tr>
					<td><a href="yueyogaAdmin/toMemberDetail.jhtml?id=${member.memberid}">${member.cardnumber}</a></td>
					<td><a href="yueyogaAdmin/toMemberDetail.jhtml?id=${member.memberid}">${member.name}</a></td>
					<td><a href="yueyogaAdmin/toMemberDetail.jhtml?id=${member.memberid}">${member.nameEn}</a></td>
					<td><a href="yueyogaAdmin/toMemberDetail.jhtml?id=${member.memberid}">${member.phone}</a></td>
					<td>${member.tel}</td>
					<td>${member.sex}</td>
				</tr>
				<!--#end-->
			</table>
			<div class="paging-page">
				<ul class="pagination">
					<li><a href="yueyogaAdmin/toUpdateLiftClub.jhtml?id=${id}&pageNo=1">首页</a></li>
					<!-- #if(pageNo==1) -->
					<li class="disabled"><a href="javascript:void(0)">上一页</a></li>
					<!-- #else -->
					<li><a href="yueyogaAdmin/toUpdateLiftClub.jhtml?id=${id}&pageNo=${prePageNo}">上一页</a></li>
					<!-- #end -->
					<!-- #if(pageNo==totalPages) -->
					<li class="disabled"><a href="javascript:void(0)">下一页</a></li>
					<!-- #else -->
					<li><a href="yueyogaAdmin/toUpdateLiftClub.jhtml?id=${id}&pageNo=${nextPageNo}">下一页</a></li>
					<!-- #end -->
					<li><a href="yueyogaAdmin/toUpdateLiftClub.jhtml?id=${id}&pageNo=${totalPages}">尾页</a></li>
					<li><a>第<input id="txtPageNumber" value="${pageNo}" onkeydown="this.value=this.value.replace(/\D/g,'')" onkeyup="changePage(this.value)" type="text" />-${totalPages}页/${totalResults}条
					</a></li>
				</ul>
			</div>
			<!-- #else -->
			<div class="panel-body">还没有会员参加该活动</div>
			<!-- #end -->
		</div>
	</div>
</body>
<script type="text/javascript">
	function documentReady() {
		var msg = "${msg}";
		if (msg == "success") {
			var d = alert("活动修改成功");
			setTimeout(function() {
				d.close().remove();
				window.location.href = "yueyogaAdmin/searchLiftClubs.jhtml?display="+"block";
			}, 1000);
		} else if (msg == "failure") {
			error("活动修改失败");
		}
	}
	$(function() {
		$("#inputStartDate").datetimepicker({
			language : "zh-CN"
		});

		$("#inputendDate").datetimepicker({
			language : "zh-CN"
		});

		$("#inputStartDate").on("dp.change", function(e) {
			$("#inputendDate").data("DateTimePicker").setMinDate(e.date);
		});

		$("#inputendDate").on("dp.change", function(e) {
			$("#inputStartDate").data("DateTimePicker").setMaxDate(e.date);
		});
		
		//去掉下拉输入框
		$("#inputLiftClubStatus").select2({
			width: "100%",
			minimumResultsForSearch: -1
		});

		$("#inputPlacement").select2('val', '${liftClub.placeId}');
		$("#inputLiftClubStatus").select2('val', '${liftClub.status}');
		$("#inputResponsible").select2('val', '${liftClub.responsibleId}');
		$("#inputCoach0").select2('val', '${liftClub.coachId0}');
		$("#inputCoach1").select2('val', '${liftClub.coachId1}');
	});
	function changePage(value) {
		value = value * 1;
		var totalPages = '${totalPages}';
		if (value > totalPages) {
			value = totalPages;
		} else if (value < 1) {
			value = 1;
		}
		$("#txtPageNumber").val(value);
		window.location.href = "yueyogaAdmin/toUpdateLiftClub.jhtml?id=${id}&pageNo="
				+ value;
	}
</script>
</html>